package com.zt.english.activity
import android.content.Intent
import android.text.TextUtils
import android.util.Log
import com.zt.english.R
import com.zt.english.databinding.ActivityTranslateBinding
import com.zt.mvvm.common.utils.gotoActivity
import com.zt.mvvm.view.BaseActivity
import com.zt.mvvm.view.BaseLifeCycleActivity
/**
 * 调用有道api实现单词文本翻译服务
 */
class TranslateActivity : BaseActivity<TranslateViewModel, ActivityTranslateBinding>() {
    override fun initView() {
        super.initView()
        mDataBinding.button1.setOnClickListener {
            val word = mDataBinding.edit.text.toString().trim()
            if(!TextUtils.isEmpty(word))
                mViewModel.translateText(word,mDataBinding.txt)
        }
    }
    override fun enterActivityAnim(startAnim: Int, exitAnim: Int) {
        super.enterActivityAnim(R.anim.translate_down_to_between,R.anim.translate_none)
    }
    override fun exitActivityAnim(startAnim: Int, exitAnim: Int) {
        super.exitActivityAnim(R.anim.translate_none,R.anim.translate_between_to_down)
    }
}